package com.example.backspring.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.backspring.entity.Fuxi;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface FuxiMapper extends BaseMapper<Fuxi> {
    @Insert("insert into fuxi (id,sj,nr,pod) values (#{id},#{sj},#{nr},#{pod})")
    int addnr(int id, String sj, String nr, int pod);

    //@Select("select * from fuxi where sj > #{zt} and sj < '12-31' ORDER BY sj  ")
    @Select("SELECT * FROM fuxi WHERE sj >= CURDATE() ORDER BY sj;")
    List<Fuxi> getnr(String zt);

    @Update("update fuxi set nr=#{nr} where id=#{id}")
    int updatenr(int id, String nr);
}
